package com.batchengine.test;

import com.batchengine.task.TaskContext;
import com.batchengine.worker.TaskExecutor;
import com.batchengine.worker.Worker;

import java.util.Date;

/**
 * Created by  solutions
 * Author: sunil.incubator@yahoo.com
 * Date: Aug 7, 2009
 */
public class HelloWorldTaskExecutor extends TaskExecutor {

    public HelloWorldTaskExecutor(String name, long taskId) {
        super(name, taskId);
    }

    protected HelloWorldTaskExecutor(String name, long taskId, ThreadGroup workGroup) {
        super(name, taskId, workGroup);
    }

    protected HelloWorldTaskExecutor(String name, long taskId, ThreadGroup workGroup, int workerPriority) {
        super(name, taskId, workGroup, workerPriority);
    }

    @Override
    protected void doWork(TaskContext context) {
        System.out.printf("----------- executing one time job @ %s%n", new Date());
    }

    public static void main(String[] args) {

        Worker worker = new HelloWorldTaskExecutor("hote", 1);
        worker.start();
    }
}
